import React from 'react';
import { inject, observer } from 'mobx-react';

@inject("wfGlobalStore", "wfLayoutStore")
@observer
export default class Main extends React.Component {
    componentWillReceiveProps(){
        const{setInvoiceCloudInfo}=this.props.wfGlobalStore;
        setInvoiceCloudInfo({fieldMark:null,detailtype:null})
    }
    render() {
        const { invoiceCloudInfo = {} } = this.props.wfGlobalStore;
        const { token, jsUrl, fieldMark, detailtype, checked = [] } = invoiceCloudInfo;
        let style = { width: "100%", height: "100%" };
        let src = `${jsUrl}/invoiceWeb/taro/dist/h5/#/pages/service/expense/index?token=${token}&fieldMark=${fieldMark}&multiple=${detailtype === 293 ? true : false}&checked=${encodeURIComponent(JSON.stringify(checked))}`;
        return (<iframe id="req_invoice_iframe" style={style} src={src} />)
    }
}